package com.lizhen.core.function.dbutils;

import com.lizhen.core.function.dbutils.dao.DAOPerson;

import java.sql.SQLException;

/**
 * @author lizhen
 */
public class DBUtils {

    /**
     * @author lizhen
     */
    public DBUtils() {
    }

    /**
     * @author lizhen
     */
    public static void main(String[] args) throws SQLException {
        new DBUtils().MySQL();
    }

    private void MySQL() {
        DAOPerson.insert("INSERT INTO person(name, age) VALUES (?,?)", "小明", "36");
        DAOPerson.query("SELECT * FROM person WHERE name=?", "小明");
        DAOPerson.update("UPDATE person SET age=? WHERE name=? and age=?", "30", "小明", "36");
        DAOPerson.delete("DELETE FROM person WHERE name=? and age!=?", "小明", "25");
    }
}